<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header3.png" alt="" />
            <div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">成果转移转化示范</div>
            <div class="center">
                <div class="search_box">
                    <div class="search_box_top">
                        <div class="search_box_top_title"></div>
                        <div>
                            <a-input-search v-model:value="value" placeholder="请输入关键词" enter-button="搜索机构" @search="onSearch" style="width: 50rem" />
                        </div>
                    </div>
                    <div class="search_box_middle1" style="padding: 3.2rem;padding-bottom: 0;">
                        <!-- <div class="search_box_middle_item">
                            <div class="search_box_middle_item_name">机构类目</div>
                            <div class="search_box_middle_item_tag">
                                <div :class="orgTypeIndex == index ? 'search_box_middle_item_tagItem active' : 'search_box_middle_item_tagItem'"
                                    v-for="(item, index) in orgTypeList" @click="orgTypeIndex = index; params.number = 1; getList()" :key="index">
                                    {{ item.name }}
                                </div>
                            </div>
                            <div class="search_box_middle_item_more"></div>
                        </div> -->
                        <!-- <div class="search_box_middle_item">
                            <div class="search_box_middle_item_name">行业类目</div>
                            <div class="search_box_middle_item_tag" :style="{ height: showMore ? 'initial' : '4.8rem' }">
                                <div :class="fieldIndex == -1 ? 'search_box_middle_item_tagItem active' : 'search_box_middle_item_tagItem'"
                                    @click="fieldIndex = -1; params.number = 1; getList()">全部</div>
                                <div :class="index == fieldIndex ? 'search_box_middle_item_tagItem active' : 'search_box_middle_item_tagItem'"
                                    v-for="(item, index) in fieldList" @click="fieldIndex = index; params.number = 1; getList()" :key="index">
                                    {{ item.name }}
                                </div>
                            </div>
                            <div class="search_box_middle_item_more" @click="showMore = !showMore">更多分类
                                <img src="../../../../../assets/more-icon.png" alt="" :style="{ transform: showMore ? 'scaleY(-1)' : 'scaleY(1)' }">
                            </div>
                        </div> -->
                    </div>
                    <div class="search_box_bottom" v-if="orgList.length">
                        <!-- <div class="search_box_bottom_title">机构记录</div> -->
                        <div class="search_box_bottom_content">
                            <div class="search_box_bottom_content_item" v-for="(item, index) in orgList" @click="goOrgDetail(item.id)">
                                <div class="search_box_bottom_content_item_left">
                                    <img :src="item.imgUrls ? item.imgUrls[0] == '/' ? baseURL + item.imgUrls : item.imgUrls : '../../../../../../src/assets/org_default.png'"
                                        alt="暂无图片" style="width:100%;height:100%" />
                                    <!-- 							<img :src="item.imgUrls" alt="" v-if="item.imgUrls" style="width:100%;height:100%">
							<img src="../../../../../assets/org_default.png" alt="" v-else style="width:100%;height:100%"> -->
                                </div>
                                <div class="search_box_bottom_content_item_right">
                                    <div class="item_title">
                                        <img v-if="orgTypeIndex == '9' || orgTypeIndex == '7' || orgTypeIndex == '10' || orgTypeIndex == '11'"
                                            src="../../../../../assets/news.png" alt="" style="width: 4rem;">
                                        <span style="margin-left: 0.5rem;">{{ item.name ? item.name.length > 20 ? item.name.slice(0,
                                    19) : item.name : '' }}</span>
                                    </div>
                                    <div class="item_content">{{ item.address }}</div>
                                    <div class="item_info">
                                        <div class="item_info_item">
                                            <img src="../../../../../assets/phone.png" alt="" style="width:1.8rem;height:1.8rem;margin-top:0.5rem">
                                            <div style="margin-left: 1rem;">联系电话：{{ item.phone }}</div>
                                        </div>
                                        <div class="item_info_item">
                                            <!-- <img src="../../../../../assets/time.png" alt=""
										style="width:1.8rem;height:1.8rem;margin-top:0.5rem">
									<div style="margin-left: 1rem;">成立时间：{{item.time}}</div> -->
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <no-Data v-else />
                    <div style="text-align: center;padding: 5rem 0;" v-if="orgList.length">
                        <a-pagination :showSizeChanger='false' v-model:current="params.number" v-model:pageSize="params.size" :total="params.total"
                            @change="onShowSizeChange" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { baseUrl } from '../../../../../../config';
import headerBox from "../../../../../components/header.vue"
import headerImg from "../../../../../components/headerImg.vue"
import footerBox from "../../../../../components/footer-box.vue"
// import actTabs from "./components/act-tabs.vue"
import noData from "../../../no-data.vue"
import {
    getResearchOrganization,
    getTechField,
    getExportDomain,
    getExportLabel,
    getExpert,
    getArea
} from "../../../../../api/scientificResearch.js"
import { getarea } from "../../../../../api/home.js"
export default {
    components: {
        headerBox,
        // actTabs,
        headerImg,
        footerBox,
        noData
    },
    data() {
        return {
            baseURL: undefined,
            params: {
                number: 1,
                size: 10,
                total: 0,
            },
            perParams: {
                number: 1,
                size: 12,
                total: 0,
            },

            technical: undefined,
            label: undefined,

            current: 1,
            tabList: ['科研机构', '科研人才'],
            tabAct: 0,
            orgList: [],
            fieldList: [],
            exportDomainList: [],
            exportLabelList: [],
            areainfo: [],
            cityList: [],
            orgTypeList: [{
                name: '全部',
                type: 0
            }, {
                name: '自治区重点实验室',
                type: 1
            }, {
                name: '技术创新中心',
                type: 2
            }, {
                name: '高新技术企业',
                type: 3
            }, {
                name: '科技型中小企业',
                type: 4
            }, {
                name: '企业研究开发中心',
                type: 5
            }, {
                name: '临床医学研究中心',
                type: 6
            }, {
                name: '成果转移转化示范区',
                type: 7
            }, {
                name: '成果平台',
                type: 8
            }, {
                name: '国家重点实验室',
                type: 9
            }, {
                name: '成果转移转化示范基地',
                type: 10
            }, {
                name: '中试熟化',
                type: 11
            }],
            perTypeList: [{
                name: '全部',
                type: 0
            }, {
                name: '教授',
                type: 1
            }, {
                name: '博士生导师',
                type: 2
            }, {
                name: '总工程师',
                type: 3
            }, {
                name: '主管',
                type: 4
            }, {
                name: '研发工程师',
                type: 5
            }, {
                name: '工程师',
                type: 6
            }, {
                name: '版权事务部主管',
                type: 7
            }, {
                name: '专利主管',
                type: 8
            }, {
                name: '高级工程师',
                type: 9
            }, {
                name: '研究员',
                type: 10
            }],
            areaList: [{ children: [] }],
            areaIndex: 0,
            headerKey: 0,
            showMore: false,
            fieldIndex: -1,
            orgTypeIndex: 0,
            perTypeIndex: 0,

            value: '',
            value1: '',
            value2: '',
            value3: '',
            tabKey: 0,
            perList: [],
            total: null,
            technical: undefined,
            province: undefined,
            city: undefined,
        }
    },
    mounted() {
        this.baseURL = baseUrl
        if (this.$route.query.tabAct) {
            this.tabAct = this.$route.query.tabAct;
            this.tabKey++
        }
        // orgTypeList/
        if (this.$route.query.orgClass) {
            for (var i in this.orgTypeList) {
                if (this.orgTypeList[i].name == this.$route.query.orgClass) {
                    this.orgTypeIndex = i
                }
            }
        }
        if (this.$route.query.typeIndex) {
            this.orgTypeIndex = this.$route.query.typeIndex
        }
        // console.log(this.tabAct);
        this.init();
        this.setTabIndex(this.tabAct);
    },
    methods: {
        setTabIndex(index) {
            localStorage.setItem('tabAct', index)
        },
        onShowSizeChange(current, pageSize) {
            this.params.number = current
            this.params.size = pageSize
            this.getList()
        },
        onShowSizeChange1(current, pageSize) {
            this.perParams.number = current
            this.perParams.size = pageSize
            this.getPerson()
        },
        toPage(item) {
            this.$router.push({
                path: 'scientificPersonDetail',
                query: {
                    tabAct: this.tabAct,
                    id: item
                }
            })
        },
        onSearch() {
            this.params.number = 1
            this.getList()
        },
        changeTab(k) {
            this.tabAct = k;
            this.setTabIndex(k)
        },
        getService(e) {
            console.log(e);
            // this.technical = e;
            // this.getCity(e);
            this.getPerson();
        },
        getOrg() {
            var orgInfo = {}
            if (this.areaIndex == -1) {
                orgInfo = {}
            } else if (this.areaIndex == 0) {
                orgInfo = { orgId: this.areaList[0].id, areaIndex: this.areaIndex, areaName: '' }
            } else {
                orgInfo = { orgId: this.areaList[0].children[this.areaIndex].id, areaIndex: this.areaIndex, areaName: '' }
            }
            localStorage.setItem('orgInfo', JSON.stringify(orgInfo))
            this.getPerson();
            this.headerKey++
        },
        getPerson() {
            var datas = {
                size: this.perParams.size,
                number: this.perParams.number,
                professionalTitle: this.perTypeIndex == 0 ? '' : this.perTypeList[this.perTypeIndex].name,
                // technical: this.technical,
                // province: this.province,
                // city: this.city,
                technical: this.technical,
                label: this.label
            }
            if (this.areaIndex == -1) {
                datas.orgFlag = '0'
            }
            getExpert(datas).then(res => {
                if (res.code === 200) {
                    this.perList = res.data.list;
                    this.total = res.data.total;
                    this.perParams.total = res.data.total ? res.data.total : 0;
                    // this.perList.map(v => {
                    // 	v.time = v.establishTime.substring(0, 10)
                    // })
                }
            })
        },
        getList() {
            var datas = {
                size: this.params.size,
                number: this.params.number,
                technical: this.fieldIndex == -1 ? '' : this.fieldList[this.fieldIndex].name,
                name: this.value,
                orgClass: this.orgTypeIndex == 0 ? '' : this.orgTypeList[this.orgTypeIndex].name
            }
            getResearchOrganization(datas).then(res => {
                if (res.code === 200) {
                    this.orgList = res.data.list;
                    this.orgList.map(v => {
                        // v.time = v.establishTime.substring(0, 10)
                    })
                    this.params.total = res.data.total ? res.data.total : 0;
                    console.log(res);
                }
            })
        },
        getCity(id) {
            // 2级
            getArea({
                arealevel: 2,
                parentId: id
            }).then(res => {
                if (res.code == 200) {
                    this.cityList = res.data
                }
            })
        },
        init() {
            getExportDomain().then(res => {
                if (res.code == 200) {
                    this.exportDomainList = res.data;
                }
            })
            getExportLabel().then(res => {
                if (res.code == 200) {
                    this.exportLabelList = res.data;
                }
            })
            getTechField().then(res => {
                if (res.code === 200) {
                    this.fieldList = res.data;
                }
            })
            // 一级
            getArea({
                arealevel: 1
            }).then(res => {
                if (res.code == 200) {
                    this.areainfo = res.data
                }
            })
            getarea({}).then((res) => {
                if (res.code == 200) {
                    this.areaList = res.data
                    if (localStorage.getItem('orgInfo')) {
                        this.areaIndex = JSON.parse(localStorage.getItem('orgInfo')).areaIndex
                        // msName.value = areadata.value[0].children[areaIndex].name
                    }
                }
            })
            this.getList();
            this.getPerson();
        },
        goOrgDetail(id) {
            console.log(id);
            this.$router.push({
                path: '/bigScreen/outcomeLandDetail',
                query: {
                    id: id
                }
            })
        },
        gotoHome() {
            this.$router.push({
                path: '/bigScreenIndex',
            })
        },
        backToOne() {
            console.log('11');
            this.$router.go(-1)
        },
        goBack() {
            this.$router.push('/chart')
        }
    }
}
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
    position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

    .backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.85);
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
        overflow-y: scroll;
        padding: 20px;
        .search_box {
            width: 140rem;
            // background: #ffffff;
            margin: 3rem auto 0;
            padding: 3rem 4rem 0rem;
            .search_box_top {
                display: flex;
                justify-content: space-between;
                align-content: center;
                padding-bottom: 3rem;
                border-bottom: 0.1rem solid #4494ff46;

                .search_box_top_title {
                    font-size: 2.4rem;
                    color: #037aff;
                }
                ::v-deep .ant-input {
                    background-color: transparent !important;
                    color: #fff;
                    border: 0.1rem solid #4494ff46;
                }
            }

            .search_box_middle1 {
                padding: 2rem 0 0 0;
                position: relative;

                .p-num {
                    position: absolute;
                    right: 0;
                    top: 3.2rem;
                    width: 20%;
                    height: 17.4rem;
                    border-left: 1px solid #4494ff46;
                    color: #888888;
                    font-size: 1.8rem;
                    text-align: center;

                    span {
                        font-size: 3.6rem;
                        color: #ce0000;
                        margin-top: 2.8rem;
                    }
                }

                .search_box_middle_item {
                    display: flex;
                    justify-content: space-between;
                    align-items: start;
                    // padding-bottom: 3rem;

                    .search_box_middle_item_name {
                        width: 8%;
                        font-size: 1.8rem;
                        color: #fff;
                    }

                    .search_box_middle_item_tag {
                        width: 84%;
                        display: flex;
                        flex-wrap: wrap;
                        overflow: hidden;
                        // justify-content: space-between;

                        .search_box_middle_item_tagItem {
                            font-size: 1.6rem;
                            color: rgba(255, 255, 255, 0.85);
                            cursor: pointer;
                            margin-right: 3rem;
                            margin-bottom: 3rem;
                        }

                        .active {
                            border-radius: 0.4rem;
                            // background: rgba(3, 122, 255, 0.1);
                            // color: #037AFF;
                            background: #037aff !important;
                            color: #ffffff !important;
                            padding: 0.3rem 1.4rem;
                        }
                    }

                    .search_box_middle_item_more {
                        width: 10%;
                        font-size: 1.6rem;
                        color: #037aff;
                        text-align: right;
                        display: flex;
                        align-items: center;
                        justify-content: flex-end;
                        cursor: pointer;

                        img {
                            margin-left: 1rem;
                        }
                    }
                }
            }

            .search_box_bottom {
                .search_box_bottom_title {
                    font-size: 2.4rem;
                    color: #037aff;
                }

                .search_box_bottom_content {
                    display: flex;
                    justify-content: space-between;
                    flex-wrap: wrap;
                    padding-top: 1.4rem;

                    .search_box_bottom_content_item {
                        display: flex;
                        justify-content: left;
                        align-items: center;
                        width: 65rem;
                        height: 16rem;
                        border-radius: 8px;
                        background-color: #082853;
                        box-sizing: border-box;
                        border: 0.1rem solid #4494ff46;
                        // box-shadow: 8px 8px 20px 0rem rgba(231, 237, 247, 0.51);
                        margin-bottom: 2rem;
                        padding: 2rem;
                        cursor: pointer;

                        .search_box_bottom_content_item_left {
                            width: 12rem;
                            height: 12rem;
                        }

                        .search_box_bottom_content_item_right {
                            display: flex;
                            justify-content: space-between;
                            flex-direction: column;
                            height: 100%;
                            width: calc(100% - 14rem);
                            margin-left: 2rem;

                            .item_title {
                                display: flex;
                                align-items: center;
                                font-size: 2rem;
                                color: #fff;
                            }

                            .item_content {
                                font-size: 1.6rem;
                                color: rgba(255, 255, 255, 0.85);
                                text-overflow: -o-ellipsis-lastline;
                                overflow: hidden; //溢出内容隐藏
                                text-overflow: ellipsis; //文本溢出部分用省略号表示
                                display: -webkit-box; //特别显示模式
                                -webkit-line-clamp: 2; //行数
                                line-clamp: 2;
                                -webkit-box-orient: vertical; //盒子中内容竖直排列
                            }

                            .item_info {
                                display: flex;
                                justify-content: space-between;
                                font-size: 1.6rem;
                                color: rgba(255, 255, 255, 0.85);

                                .item_info_item {
                                    display: flex;
                                    // align-items: center;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    ::-webkit-scrollbar {
        width: 5px;
        height: 10px;
    }

    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background-color: #234470;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        background-color: #061c57;
    }

    /* 鼠标悬停在滚动条上的滑块 */
    ::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}::v-deep {
    .ant-btn-primary {
        border-color: #037aff;
        background: #037aff;
    }

    .ant-input {
        background: rgba(68, 148, 255, 0.12);
        border: none;
        color: #ffffff;
    }

    .ant-pagination-item {
        background: rgba(8, 26, 48, 0.8);
        border: 1px solid #0b2f5f;
    }

    .ant-pagination-item a {
        color: #ffffff;
    }

    .ant-pagination-prev .ant-pagination-item-link,
    .ant-pagination-next .ant-pagination-item-link {
        background: rgba(8, 26, 48, 0.8);
        border: 1px solid #0b2f5f;
        color: #707981;
    }

    .ant-pagination-disabled .ant-pagination-item-link {
        background: rgba(8, 26, 48, 0.8);
        border: 1px solid #0b2f5f;
        color: #707981;
    }

    .ant-pagination-item-active {
        background: #004dfd;
        border-radius: 2px;
        border: none;
    }

    .ant-pagination-jump-prev
        .ant-pagination-item-container
        .ant-pagination-item-ellipsis,
    .ant-pagination-jump-next
        .ant-pagination-item-container
        .ant-pagination-item-ellipsis {
        color: #ffffff;
    }
    .ant-select-selector {
        background-color: transparent !important;
        background: rgba(8, 26, 48, 0.8) !important;
        border: 1px solid #0b2f5f !important;
        color: #ffffff !important;
    }
}
</style>
